<template>
  <div>
    <h3>这里是第二个页面1：{{msg}}</h3>
    <h2>这里是第二个页面2：{{msg2}}</h2>
  </div>

</template>
<script>
  export default {
    name: '',
    data () {
      return {
        msg: '',
        msg2: ''
      }
    },
    methods: {
      getParams () {
        let routerParams = this.$route.query
        this.msg= routerParams.data
        this.msg2=routerParams.data2
      }
    },
    mounted(){
     this.getParams()
    }
    // watch: {
    //   '$route': 'getParams'
    // }
  }
</script>
<style scoped></style>
